﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="AprobarRequerimientos.aspx.cs" Inherits="AppGestionRequerimientos.AprobarRequerimientos" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <!-- Use the .htaccess and remove these lines to avoid edge case issues.
	       More info: h5bp.com/b/378 -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="description" content="Sistema ASR" />
        <meta name="author" content="Anovo Peru" />
        <!-- Mobile viewport optimized: h5bp.com/viewport -->
        <meta name="viewport" content="width=device-width,initial-scale=1" />
        <!-- iPhone: Don't render numbers as call links -->
        <meta name="format-detection" content="telephone=no" />
        <link rel="shortcut icon" href="favicon.ico" />
        <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
        <!-- The Styles -->
        <!-- ---------- -->
        <!-- Layout Styles -->
        <link rel="stylesheet" href="css/style.css" />
        <link rel="stylesheet" href="css/grid.css" />
        <link rel="stylesheet" href="css/layout.css" />
        <!-- Icon Styles -->
        <link rel="stylesheet" href="css/icons.css" />
        <link rel="stylesheet" href="css/fonts/font-awesome.css" />
        <!--[if IE 8]><link rel="stylesheet" href="css/fonts/font-awesome-ie7.css"><![endif]-->
        <!-- External Styles -->
        <link rel="stylesheet" href="css/external/jquery-ui-1.8.21.custom.css" />
        <link rel="stylesheet" href="css/external/jquery.chosen.css" />
        <link rel="stylesheet" href="css/external/jquery.cleditor.css" />
        <link rel="stylesheet" href="css/external/jquery.colorpicker.css" />
        <link rel="stylesheet" href="css/external/jquery.elfinder.css" />
        <link rel="stylesheet" href="css/external/jquery.fancybox.css" />
        <link rel="stylesheet" href="css/external/jquery.jgrowl.css" />
        <link rel="stylesheet" href="css/external/jquery.plupload.queue.css" />
        <link rel="stylesheet" href="css/external/syntaxhighlighter/shCore.css" />
        <link rel="stylesheet" href="css/external/syntaxhighlighter/shThemeDefault.css" />
        <!-- Elements -->
        <link rel="stylesheet" href="css/elements.css" />
        <link rel="stylesheet" href="css/forms.css" />
        <!-- OPTIONAL: Print Stylesheet for Invoice -->
        <link rel="stylesheet" href="css/print-invoice.css" />
        <!-- Typographics -->
        <link rel="stylesheet" href="css/typographics.css" />
        <!-- Responsive Design -->
        <link rel="stylesheet" href="css/media-queries.css" />
        <!-- Bad IE Styles -->
        <link rel="stylesheet" href="css/ie-fixes.css" />
        <!-- The Scripts -->
        <!-- ----------- -->
        <!-- JavaScript at the top (will be cached by browser) -->
        <script type="text/javascript" src="js/webfont.js"></script>
        <!-- Essential polyfills -->
        <script type="text/javascript" src="js/mylibs/polyfills/modernizr-2.6.1.min.js"></script>
        <script type="text/javascript" src="js/mylibs/polyfills/respond.js"></script>
        <script type="text/javascript" src="js/mylibs/polyfills/matchmedia.js"></script>
        <!--[if lt IE 9]><script src="js/mylibs/polyfills/selectivizr-min.js"></script><![endif]-->
        <!--[if lt IE 10]><script src="js/mylibs/charts/excanvas.js"></script><![endif]-->
        <!--[if lt IE 10]><script src="js/mylibs/polyfills/classlist.js"></script><![endif]-->
        <!-- Grab frameworks from CDNs -->
        <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript">            window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')</script>
        <!-- Do the same with jQuery UI -->
        <script type="text/javascript" src="js/jquery-ui.min.js"></script>
        <script type="text/javascript">            window.jQuery.ui || document.write('<script src="js/libs/jquery-ui-1.8.21.min.js"><\/script>')</script>
        <!-- Do the same with Lo-Dash.js -->
        <script type="text/javascript" src="js/lodash.min.js"></script>
        <script type="text/javascript">            window._ || document.write('<script src="js/libs/lodash.min.js"><\/script>')</script>
        <!-- scripts concatenated and minified via build script -->
        <!-- General Scripts -->
        <script type="text/javascript" src="js/mylibs/jquery.hashchange.js"></script>
        <script type="text/javascript" src="js/mylibs/jquery.idle-timer.js"></script>
        <script type="text/javascript" src="js/mylibs/jquery.plusplus.js"></script>
        <script type="text/javascript" src="js/mylibs/jquery.jgrowl.js"></script>
        <script type="text/javascript" src="js/mylibs/jquery.scrollTo.js"></script>
        <script type="text/javascript" src="js/mylibs/jquery.ui.touch-punch.js"></script>
        <script type="text/javascript" src="js/mylibs/jquery.ui.multiaccordion.js"></script>
        <script type="text/javascript" src="js/mylibs/number-functions.js"></script>
        <!-- Forms -->
        <script type="text/javascript" src="js/mylibs/forms/jquery.autosize.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.checkbox.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.chosen.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.cleditor.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.colorpicker.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.ellipsis.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.fileinput.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.fullcalendar.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.maskedinput.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.mousewheel.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.placeholder.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.pwdmeter.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.ui.datetimepicker.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.ui.spinner.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/jquery.validate.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/uploader/plupload.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/uploader/plupload.html5.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/uploader/plupload.html4.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/uploader/plupload.flash.js"></script>
        <script type="text/javascript" src="js/mylibs/forms/uploader/jquery.plupload.queue/jquery.plupload.queue.js"></script>
        <!-- Charts -->
        <script type="text/javascript" src="js/mylibs/charts/jquery.flot.js"></script>
        <script type="text/javascript" src="js/mylibs/charts/jquery.flot.orderBars.js"></script>
        <script type="text/javascript" src="js/mylibs/charts/jquery.flot.pie.js"></script>
        <script type="text/javascript" src="js/mylibs/charts/jquery.flot.resize.js"></script>
        <!-- Explorer -->
        <script type="text/javascript" src="js/mylibs/explorer/jquery.elfinder.js"></script>
        <!-- Fullstats -->
        <script type="text/javascript" src="js/mylibs/fullstats/jquery.css-transform.js"></script>
        <script type="text/javascript" src="js/mylibs/fullstats/jquery.animate-css-rotate-scale.js"></script>
        <script type="text/javascript" src="js/mylibs/fullstats/jquery.sparkline.js"></script>
        <!-- Syntax Highlighter -->
        <script type="text/javascript" src="js/mylibs/syntaxhighlighter/shCore.js"></script>
        <script type="text/javascript" src="js/mylibs/syntaxhighlighter/shAutoloader.js"></script>
        <!-- Dynamic Tables -->
        <script type="text/javascript" src="js/mylibs/dynamic-tables/jquery.dataTables.js"></script>
        <script type="text/javascript" src="js/mylibs/dynamic-tables/jquery.dataTables.tableTools.zeroClipboard.js"></script>
        <script type="text/javascript" src="js/mylibs/dynamic-tables/jquery.dataTables.tableTools.js"></script>
        <!-- Gallery -->
        <script type="text/javascript" src="js/mylibs/gallery/jquery.fancybox.js"></script>
        <!-- Tooltips -->
        <script type="text/javascript" src="js/mylibs/tooltips/jquery.tipsy.js"></script>
        <!-- Do not touch! -->
        <script type="text/javascript" src="js/mango.js"></script>
        <script type="text/javascript" src="js/plugins.js"></script>
        <script type="text/javascript" src="js/script.js"></script>
        <!-- Your custom JS goes here -->
        <script type="text/javascript" src="js/app.js"></script>
    <!-- end scripts -->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="grid_12">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <%--<form action="RegistrarRequerimientos.aspx" class="box validate" method="post" onsubmit="btnConsultar">--%>
            <div class="header">
                <div class="row">
                    <h1 class="grid_12">Requerimientos por Aprobar</h1>
                </div>
                <asp:HiddenField ID="hrRespuesta" runat="server" />
            </div>
            <% if (hrRespuesta.Value == "0") {%>
            <div class="alert error">
                <span class="icon"></span><strong>Error!</strong> Ha ocurrido un error al grabar.
            </div>
            <%}
               else if (hrRespuesta.Value == "1")
               {%>
            <div class="alert success">
                <span class="icon"></span><strong>Correcto!</strong> Se ha aprobado el requerimiento correctamente.
            </div>
            <%}
                else if (hrRespuesta.Value == "2")
            { %>
            <div class="alert information">
                <span class="icon"></span><strong>Informacion</strong> No existen Requerimientos que coincidan con los criterios seleccionados.
            </div>
            <%} %>

            <div class="content">
                <div class="row">
                    <h2>Seleccione criterios de b&uacute;squeda:</h2>
                </div>
                <div class="row">
                    <p class="_25"><label>Nro. de Requerimiento:</label></p>
                    <p class="_25">
                        <asp:TextBox ID="txtNroReq" runat="server" MaxLength="10"></asp:TextBox>
                    </p>
                    <p class="_25"><label>Usuario solicitante:</label></p>
                    <p class="_25">    
                        <asp:DropDownList ID="cboUsuario" runat="server" CssClass="search" data-placeholder="---Seleccione Usuario---"
                        AppendDataBoundItems="true" DataTextField="vNomUsu" DataValueField="iCodUsu" Enabled="true" >
                        </asp:DropDownList>
                    </p>
                </div>
                <div class="row">
                    <p class="_25"><label>Fecha Inicial: (dd/mm/yyyy)</label></p>
                    <p class="_25">
                        <asp:TextBox ID="txtFechaInicio" runat="server" Text="" MaxLength="10"></asp:TextBox>
                    </p>
                    <p class="_25"><label>Fecha Final: (dd/mm/yyyy)</label></p>
                    <p class="_25">    
                        <asp:TextBox ID="txtFechaFin" runat="server" MaxLength="10"></asp:TextBox>
                    </p>
                </div>
                <div class="row">
                    <p class="_25">
                        <label>&nbsp;</label>
                    </p>
                    <p class="_25">                    
                        <asp:Button ID="btnConsultar" runat="server" Text="Consultar" OnClick="btnConsultar_Click"/>
                    </p>
                    <p class="_25">
                        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" onclick="btnConsultar_Click"/>
                    </p>           
                    <p class="_25">
                        <label>&nbsp;</label>
                    </p>         
                </div>
            </div>
            <div class="header">
                <div class="row">
                    <h2>Requerimientos encontrados:</h2>
                </div>
            </div>
            <div class="content">
                <div class="row">
                    <center>
                        <asp:GridView 
                            ID="grillaEncontrados" runat="server" AutoGenerateColumns="False" CssClass="dynamic styled" 
                            ShowHeaderWhenEmpty="true" data-filter-bar="always" data-table-tools='{"display":false}' 
                            EmptyDataText="No se han encontrado resultados" OnPreRender="grillaEncontrados_PreRender"  Width="50%" 
                            onselectedindexchanged="grillaEncontrados_SelectedIndexChanged">
                            <Columns>
                                <asp:BoundField DataField="iNumReq" HeaderText="Nro. Req." />
                                <asp:BoundField DataField="dtFecReq" HeaderText="Fecha Req." />
                                <asp:BoundField DataField="vHorReq" HeaderText="Hora Req." />
                                <asp:BoundField DataField="vNomUsuReg" HeaderText="Usuario Solic." />
                                <asp:BoundField DataField="vNomEstReq" HeaderText="Estado Req." />
                                <asp:BoundField DataField="vObsReq" HeaderText="Observaciones" />
                                <asp:BoundField DataField="vNomUsuA" HeaderText="Usuario Act." />
                                <asp:BoundField DataField="vNomTer" HeaderText="Terminal Act." />
                                <asp:BoundField DataField="dtFecAct" HeaderText="Fecha Act." />
                                <asp:CommandField ButtonType="Image" HeaderText="Seleccionar" SelectImageUrl="~/img/ok.png" ShowSelectButton="True" />
                            </Columns>
                            <EmptyDataTemplate><label>No se encontraron registros</label></EmptyDataTemplate>
                        </asp:GridView>
                    </center>
                </div>
            </div>
            <asp:HiddenField ID="hdNumReq" runat="server" />
            <asp:HiddenField ID="hdEstReq" runat="server" />
            <div class="header">
                <div class="row">
                    <h2>Detalle de Requerimiento:</h2>
                </div>
            </div>
            <div class="content">
                <div class="row">
                    <center>
                        <asp:GridView 
                            ID="gdvDetalle" runat="server" AutoGenerateColumns="False" CssClass="dynamic styled" 
                            ShowHeaderWhenEmpty="true" data-filter-bar="always" data-table-tools='{"display":false}' 
                            EmptyDataText="No se han encontrado resultados" OnPreRender="gdvDetalle_PreRender"  Width="50%">
                            <Columns>
                                <asp:BoundField DataField="iNumReq" HeaderText="Nro. Req." />                                            
                                <asp:BoundField DataField="iCodMat" HeaderText="Cod. Material" />
                                <asp:BoundField DataField="vNomMat" HeaderText="Material" />
                                <asp:BoundField DataField="nCanReq" HeaderText="Cantidad" />
                                <asp:BoundField DataField="vNomUsu" HeaderText="Usuario Act." />
                                <asp:BoundField DataField="vNomTer" HeaderText="Terminal Act." />
                                <asp:BoundField DataField="dtFecAct" HeaderText="Fecha Act." />                                            
                            </Columns>
                            <EmptyDataTemplate><label>No se encontraron registros</label></EmptyDataTemplate>
                        </asp:GridView>
                    </center>
                </div>
                <div class="row">                                    
                    <p class="_25">Aprobar?:                               </p>
                    <p class="_75">
                        <asp:DropDownList ID="ddlAprobar" runat="server" CssClass="search" Enabled="true" >
                            <asp:ListItem Text="---Seleccione Decisión---" Value="-1"></asp:ListItem>   
                            <asp:ListItem Text="Aprobar" Value="1"></asp:ListItem>  
                            <asp:ListItem Text="Rechazar" Value="0"></asp:ListItem>   
                        </asp:DropDownList>
                    </p>
                </div>
                <div class="row">
                    <p class="_25"> Observaciones: </p>
                    <p class="_75">
                        <asp:TextBox ID="txtObservaciones" runat="server" ></asp:TextBox>
                    </p>
                </div>                                    
                <div class="row" >                                        
                        <asp:Button ID="btnGrabar" runat="server" Text="Grabar" CssClass="button" onclick="btnGrabar_Click" />                                         
                </div>
            </div>
        </div>                          
        <%--</form>--%>
    </div>

</asp:Content>
